package com.victor.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.victor.entity.JQActiviClassone;
import com.victor.entity.JQActiviClasstwo;
import com.victor.entity.JQActivity;
import com.victor.entity.JQActivityTime;

@Mapper
public interface JingquActivityDao {

	/**
	 * 获取第一分类
	 * 
	 * @return
	 */
	@Select({ "select * from jqactiviclassone order by id desc" })
	List<JQActiviClassone> getClassOne();

	/**
	 * 获取第二分类
	 * 
	 * @param classoneid
	 * @return
	 */
	@Select({ "select * from jqactiviclasstwo where classoneid=#{classoneid} order by id desc" })
	List<JQActiviClasstwo> getClassTwo(@Param("classoneid") String classoneid);

	/**
	 * 获取景区活动列表(景区id)
	 * 
	 * @param jqid
	 * @return
	 */
	List<JQActivity> getJQactivity(@Param("jqid") String jqid);

	/**
	 * 新建景区活动
	 * 
	 * @param jqActivity
	 * @return
	 */
//	@Insert({
//			"insert into jqactivity (jqid,title,title_vice,site,price,photo_video,time,introduce,lengthoftime,classoneid,classtwoid) values (#{jqid},#{title},#{title_vice},#{site},#{price},#{photo_video},#{time},#{introduce},#{lengthoftime},#{classoneid},#{classtwoid})" })
	int buildJQactivity(JQActivity jqActivity);

	/**
	 * 修改景区活动
	 * 
	 * @param jqActivity
	 * @return
	 */
	int updateJQactivity(JQActivity jqActivity);

	/**
	 * 批量删除景区活动
	 * 
	 * @param jqActivitys
	 * @return
	 */
	int deleteJQactivity(@Param("jqActivitys") int[] jqActivitys);

	/**
	 * 新建景区活动时间
	 * 
	 * @param jqActivityTime
	 * @return
	 */
	@Insert({ "insert into jqactivity_time (jqacid,time) values (#{jqacid},#{time})" })
	int buildJQactivityTime(JQActivityTime jqActivityTime);

}
